package com.hwadee.springboot_lx.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "grade")
public class Grade {
    @Id
    @Column(name = "GradeID", nullable = false)
    private Integer id;

    @Column(name = "Score", precision = 10)
    private BigDecimal score;

    @Column(name = "GradeTime")
    private Instant gradeTime;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "ClassID", nullable = false)
    private Class classID;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "StudentID", nullable = false)
    private Student studentID;

}